package base;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.function.BiConsumer;
import java.util.function.Consumer;

/**
 * @Auther DRevelation
 * @Date 2020-05-25 下午 13:59
 * @Desc
 */
public class FunctionInterfaceDemo {

    public static void main(String[] args) {
        new Thread(() -> System.out.println("void"));

        Map<String, String> map = new HashMap<>();
        map.put("a", "aa");
        map.put("b", "bb");
        map.put("c", "cc");
        System.out.println("=========");
        BiConsumer bi = (k, v) -> System.out.println(k + ": " + v);
        bi.accept(map.keySet(), map.entrySet());
        map.forEach((k, v) -> System.out.println(k + ": " + v));

        List<String> list = new ArrayList<>();
        list.add("hello");
        list.add("lambda");

        Consumer c = (l) -> System.out.println(l);
        c.accept(list);
        list.forEach(System.out::println);
    }
}
